package com.crazy.bookstore.exception;

import lombok.Data;

/**
 * @author: 卢辉宇
 * @date: 2022/12/27 14:22
 * @description:
 */
@Data
public class MyException extends Exception{
    private final Integer CODE;
    private final String MSG;

    /*传统的构造方法*/
    public MyException(Integer CODE, String MSG) {
        this.CODE = CODE;
        this.MSG = MSG;
    }

    /*传入枚举的构造方法*/
    public MyException(ExceptionEnum ex) {
        this.CODE = ex.getCode();
        this.MSG = ex.getMsg();
    }
}
